<template>
	<div>
		<HomeHeader></HomeHeader>
		<HomeLeft :cur="12"></HomeLeft>
		<div id="main">
			<div id="web_con">
				<div class="web_wp">
					<div class="web_location">
						<div class="here_area">
							<strong>当前位置：</strong>日志管理
						</div>
						<div class="here_btn">

						</div>
					</div>
					<!-- <div class="tabTitle">
						<ul class="clearfix">
							<li class="cur"><a href="javascript:;">地域分类</a></li>
							<li class=""><a href="javascript:;">地域分类</a></li>
						</ul>
						<div class="c"></div>
					</div> -->
					
					<div class="web_table">
						<table>
							<tr>
								
								<th class="tac">ID</th>
								<th class="tac">用户名</th>
								<th class="tac">请求方式</th>
								<th class="tac">接口路径</th>
								<th class="tac">时间</th>
							</tr>
							<tr v-for="(item,i) in listinfo.data" :key="i">
								
								<td class="tac">{{item.id}}</td>
								<td class="tac">{{item.user.username}}</td>
								<td class="tac">{{item.method}}</td>
								<td class="tac">{{item.uri}}</td>
								<td class="tac"> {{common.FormatDate(item.created_at,1)}}</td>
								
							</tr>
						</table>
					</div>
					<div class="web_page">
						<el-pagination background @current-change="ChengPage" :current-page="page" :page-size="limit"
							layout="total,prev, pager,next" :total="listinfo.total">
						</el-pagination>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import HomeHeader from '../components/Header.vue'
	import HomeLeft from '../components/Left.vue'
	export default {
		components: {
			HomeHeader,
			HomeLeft,

		},
		data() {
			return {
				page: 1,
				listinfo: [],
				limit:20,
			}
		},
		onShow() {
			this.GetList();
		},
		methods: {
			GetList: function() {
				let that = this;
				uni.showLoading({
					title: '加载中...',
					mask: true
				});
				let _data = {
					page: that.page,
					limit:that.limit
				};
				that.common.http('GET', 'operate/index', _data, function(res) {
					uni.hideLoading();
					console.log(res)
					that.listinfo = res.data
				});
			},
			ChengPage: function(e) {
				this.page = e;
				this.GetList();
			},
		}
	}
</script>

<style>


</style>